import QtQuick 2.0
import QtQuick.Controls 2.3
import "storage.js" as Storage

Item {
    id: root
    width: 1024
    height: 610
    property real minSize: Math.min(width/1024, height/610)
    property bool initFlag: false

    property bool g_overVoltageFlag: false
    property bool g_deexcOFFlag: false
    property color majorColor: "#44fdfd"
    property color majorColorLow: "#8844fdfd"
    property color majorColorDeep: "#2299bb"

    signal qmlSN_sqlWriteFinish()
    onQmlSN_sqlWriteFinish: {
        if(!focus && $sqlMcRecorder.qml_getRefurbishFlag()) return
        if($sqlMcRecorder.qml_getPrintFlag()) console.log("->page2 operater start")
        if($sqlMcRecorder.qml_getBitBool("A套","调节器状态","本通道运行")) text_mainStatuChA.state = "1"
        else text_mainStatuChA.state = "2"
        if($sqlMcRecorder.qml_getBitBool("B套","调节器状态","本通道运行")) text_mainStatuChB.state = "1"
        else text_mainStatuChB.state = "2"
        if($sqlMcRecorder.qml_getBitBool("A套","调节器状态","自动方式")) text_runModelChA.state = "1"
        if($sqlMcRecorder.qml_getBitBool("A套","调节器状态","手动方式")) text_runModelChA.state = "2"
        if($sqlMcRecorder.qml_getBitBool("B套","调节器状态","自动方式")) text_runModelChB.state = "1"
        if($sqlMcRecorder.qml_getBitBool("B套","调节器状态","手动方式")) text_runModelChB.state = "2"


        var t_sumCur=0
        var t_sumCount=0
        var t_powerTop=0
        var t_real2 = 0.1*$sqlMcRecorder.qml_getRecordVal_bystr_touint16("1#功率柜电流")
        text_powerCabinet1_Cur.text = t_real2.toFixed(1)+"A"
        if($sqlMcRecorder.qml_getBitBool("1#","功率柜状态","功率柜退出")) text_powerCabinet1_cutin.state = "2"
        else {text_powerCabinet1_cutin.state = "1";t_sumCur+=t_real2;t_sumCount++;t_powerTop=Math.max(t_real2,t_powerTop)}
        if($sqlMcRecorder.qml_getBitBool("1#","功率柜状态","功率柜均流投入")) text_powerCabinet1_CurEqu.state = "2"
        else text_powerCabinet1_CurEqu.state = "1"
        t_real2 = 0.01*$sqlMcRecorder.qml_getRecordVal_bystr_toint16("1#功率柜1PT风温")
        text_powerCabinet1_Temp1.text = t_real2.toFixed(2)+"°C"
        t_real2 = 0.01*$sqlMcRecorder.qml_getRecordVal_bystr_toint16("1#功率柜2PT风温")
        text_powerCabinet1_Temp2.text = t_real2.toFixed(2)+"°C"

        t_real2 = 0.1*$sqlMcRecorder.qml_getRecordVal_bystr_touint16("2#功率柜电流")
        text_powerCabinet2_Cur.text = t_real2.toFixed(1)+"A"
        if($sqlMcRecorder.qml_getBitBool("2#","功率柜状态","功率柜退出")) text_powerCabinet2_cutin.state = "2"
        else {text_powerCabinet2_cutin.state = "1";t_sumCur+=t_real2;t_sumCount++;t_powerTop=Math.max(t_real2,t_powerTop)}
        if($sqlMcRecorder.qml_getBitBool("2#","功率柜状态","功率柜均流投入")) text_powerCabinet2_CurEqu.state = "2"
        else text_powerCabinet2_CurEqu.state = "1"
        t_real2 = 0.01*$sqlMcRecorder.qml_getRecordVal_bystr_toint16("2#功率柜1PT风温")
        text_powerCabinet2_Temp1.text = t_real2.toFixed(2)+"°C"
        t_real2 = 0.01*$sqlMcRecorder.qml_getRecordVal_bystr_toint16("2#功率柜2PT风温")
        text_powerCabinet2_Temp2.text = t_real2.toFixed(2)+"°C"

        t_real2 = 0.1*$sqlMcRecorder.qml_getRecordVal_bystr_touint16("3#功率柜电流")
        text_powerCabinet3_Cur.text = t_real2.toFixed(1)+"A"
        if($sqlMcRecorder.qml_getBitBool("3#","功率柜状态","功率柜退出")) text_powerCabinet3_cutin.state = "2"
        else {text_powerCabinet3_cutin.state = "1";t_sumCur+=t_real2;t_sumCount++;t_powerTop=Math.max(t_real2,t_powerTop)}
        if($sqlMcRecorder.qml_getBitBool("3#","功率柜状态","功率柜均流投入")) text_powerCabinet3_CurEqu.state = "2"
        else text_powerCabinet3_CurEqu.state = "1";
        t_real2 = 0.01*$sqlMcRecorder.qml_getRecordVal_bystr_toint16("3#功率柜1PT风温")
        text_powerCabinet3_Temp1.text = t_real2.toFixed(2)+"°C"
        t_real2 = 0.01*$sqlMcRecorder.qml_getRecordVal_bystr_toint16("3#功率柜2PT风温")
        text_powerCabinet3_Temp2.text = t_real2.toFixed(2)+"°C"

        //        if($sqlMcRecorder.qml_getBitBool("4#","功率柜状态","功率柜退出")) text_powerCabinet4_cutin.state = "2"
        //        else text_powerCabinet4_cutin.state = "1"
        //        if($sqlMcRecorder.qml_getBitBool("4#","功率柜状态","功率柜均流投入")) text_powerCabinet4_CurEqu.state = "2"
        //        else text_powerCabinet4_CurEqu.state = "1"
        //        t_real2 = 0.1*$sqlMcRecorder.qml_getRecordVal_bystr_touint16("4#功率柜电流")
        //        text_powerCabinet4_Cur.text = t_real2.toFixed(1)+"A"
        //        t_real2 = 0.01*$sqlMcRecorder.qml_getRecordVal_bystr_toint16("4#功率柜1PT风温")
        //        text_powerCabinet4_Temp1.text = t_real2.toFixed(2)+"°C"
        //        t_real2 = 0.01*$sqlMcRecorder.qml_getRecordVal_bystr_toint16("4#功率柜2PT风温")
        //        text_powerCabinet4_Temp2.text = t_real2.toFixed(2)+"°C"

        if(t_sumCount!==0) text_junliu.text = String((100*t_sumCur/t_sumCount/t_powerTop).toFixed(2))+"%"
        else text_junliu.text = "???"

        if($sqlMcRecorder.qml_getBitBool("","灭磁柜状态","QFG在分状态")) imageSwitchMagnetic.state = "1"
        else if($sqlMcRecorder.qml_getBitBool("","灭磁柜状态","QFG在合状态")) imageSwitchMagnetic.state = "2"
        else imageSwitchMagnetic.state = "3"

        //        var t_runningchannel = Storage.readWhichChannelRunning()
        if($sqlMcRecorder.qml_getBitBool(Storage.readWhichChannelRunning(),"调节器状态","并网运行")) imageSwitchCirBreak.state = "2"
        else imageSwitchCirBreak.state = "1"

        var t_var = Storage.readWhichChannelRunning()
        var t_real = 0.01*$sqlMcRecorder.qml_getRecordVal_bystr_toint16(t_var+"机端电压")
        text_ugPer.text = t_real.toFixed(2) + "%"
        if(t_real>10) image_rotor.state = "2";
        else image_rotor.state = "1";
        t_real = t_real*0.01*$sqlMcRecorder.qml_getFactor("stator_voltage")
        text_ug.text = t_real.toFixed(2) + "V"

        t_real = 0.01*$sqlMcRecorder.qml_getRecordVal_bystr_toint16(t_var+"机端电流")
        text_igPer.text = t_real.toFixed(2) + '%'
        t_real = t_real*0.01*$sqlMcRecorder.qml_getFactor("stator_current")
        text_ig.text = t_real.toFixed(2) + "A"

        t_real = 0.01*$sqlMcRecorder.qml_getRecordVal_bystr_toint16(t_var+"有功功率")
        text_pPer.text = t_real.toFixed(2) + '%'
        t_real = t_real*0.00001*$sqlMcRecorder.qml_getFactor("motor_capacity")
        text_p.text = t_real.toFixed(2) + "MW"

        t_real = 0.01*$sqlMcRecorder.qml_getRecordVal_bystr_toint16(t_var+"无功功率")
        text_qPer.text = t_real.toFixed(2) + '%'
        t_real = t_real*0.00001*$sqlMcRecorder.qml_getFactor("motor_capacity")
        text_q.text = t_real.toFixed(2) + "MVar"

        t_real = 0.01*$sqlMcRecorder.qml_getRecordVal_bystr_toint16(t_var+"功率因数")
        text_pf.text = t_real.toFixed(2) + '%'

        t_real = 0.01*$sqlMcRecorder.qml_getRecordVal_bystr_touint16(t_var+"电压频率")
        text_f.text = t_real.toFixed(2) + "Hz"

        t_real = 0.1*$sqlMcRecorder.qml_getRecordVal_bystr_toint16("灭磁柜电流")
        text_if.text = t_real.toFixed(1) + "A"

        t_real = 0.1*$sqlMcRecorder.qml_getRecordVal_bystr_toint16("灭磁柜电压")
        text_uf.text = t_real.toFixed(1) + "V"

        //        t_real = 0.01*$sqlMcRecorder.qml_getRecordVal_bystr_toint16("转子温度")
        //        text_rotorTemp.text = t_real.toFixed(2) + "°C"

        if($sqlMcRecorder.qml_getBitBool("","灭磁柜故障","过压保护动作")!==g_overVoltageFlag){
            g_overVoltageFlag = !g_overVoltageFlag
            if(g_overVoltageFlag) {
                var t_var2 = $sqlMcRecorder.qml_getFactor("过压保护动作次数")
                $sqlMcRecorder.qml_setMotorFactor("过压保护动作次数", ++t_var2)
                text_overVoltage.text = String(t_var2)+qsTr("次")
            }
        }
        if($sqlMcRecorder.qml_getBitBool("","灭磁柜状态","QFG在合状态")!==g_deexcOFFlag){
            g_deexcOFFlag = !g_deexcOFFlag
            if(g_deexcOFFlag) {
                var t_var3 = $sqlMcRecorder.qml_getFactor("灭磁开关分合次数")
                if(initFlag){
                    $sqlMcRecorder.qml_setMotorFactor("灭磁开关分合次数", ++t_var3)
                    text_deexcOF.text = String(t_var3)+qsTr("次")
                }
                else initFlag=true
            }
        }
    }

    Component.onCompleted: timerOnCompleted.start()
    Timer{
        id:timerOnCompleted
        interval: 1000
        repeat: false
        triggeredOnStart: false
        property int thisCounter: 0
        onTriggered: {
            text_overVoltage.text = $sqlMcRecorder.qml_getFactor("过压保护动作次数")+qsTr("次")
            text_deexcOF.text = $sqlMcRecorder.qml_getFactor("灭磁开关分合次数")+qsTr("次")
        }
    }

    Rectangle {
        id: rectangle
        width: 233*root.minSize
        height: 220*root.minSize
        color: majorColorDeep
        radius: 10*root.minSize
        property int textSize: 20*root.minSize
        property int textSize2: 18*root.minSize
        x: 196*root.minSize
        y: 390*root.minSize

        Text {
            x: 10*root.minSize
            y: 10*root.minSize
            text: "Uf:"
            font.pixelSize: parent.textSize
            color: majorColor
        }

        Text {color: majorColor
            x: 20*root.minSize
            y: 45*root.minSize
            text: "If:"
            font.pixelSize: parent.textSize
        }

        Text {color: majorColor
            id: text_uf
            x: 45*root.minSize
            y: 8*root.minSize
            text: "???V"
            font.family: "Tahoma"
            font.pixelSize: parent.textSize
        }

        Text {color: majorColor
            id: text_if
            x: 45*root.minSize
            y: 45*root.minSize
            text: "???A"
            font.family: "Tahoma"
            font.pixelSize: parent.textSize
        }

        Text {color: majorColor
            x: 8*root.minSize
            y: 160*root.minSize
            text: qsTr("过压动作:")
            font.pixelSize: parent.textSize2
        }

        Text {color: majorColor
            id: text_overVoltage
            x: 95*root.minSize
            y: 160*root.minSize
            text: "???次"
            font.pixelSize: parent.textSize2
        }

        Text {color: majorColor
            x: 8*root.minSize
            y: 185*root.minSize
            text: qsTr("开关分合:")
            font.pixelSize: parent.textSize2
        }

        Text {color: majorColor
            id: text_deexcOF
            x: 95*root.minSize
            y: 185*root.minSize
            text: "???次"
            font.pixelSize: parent.textSize2
        }
    }

    Image {
        id: img
        anchors.fill: parent
        fillMode: Image.PreserveAspectCrop
        source: "../picture/p2_systemSimple/p2_systemSimple.png"

        Image {
            id: imageSwitchCirBreak
            x: 65*root.minSize
            y: 80*root.minSize
            width: sourceSize.width*1.5*root.minSize
            height: sourceSize.height*1.5*root.minSize
            rotation: 90
            fillMode: Image.PreserveAspectCrop
            //            source: "../picture/p2_systemSimple/switch.png"
            state: "1"


            Text {color: majorColor
                id: textSwitchCirBreak
                y: -90*root.minSize
                text: qsTr("出口断路器分")
                anchors.leftMargin: -40*root.minSize
                anchors.left: parent.left
                rotation: -90
                font.bold: true
                font.family: "Verdana"
                font.pixelSize: 20*root.minSize
            }

            states:[
                State {
                    name: "1"
                    PropertyChanges {
                        target: imageSwitchCirBreak
                        source: "../picture/p2_systemSimple/switch.png"
                    }
                    PropertyChanges {
                        target: textSwitchCirBreak
                        text: qsTr("出口断路器分")
                    }
                },
                State {
                    name: "2"
                    PropertyChanges {
                        target: imageSwitchCirBreak
                        source: "../picture/p2_systemSimple/switch_on.png"
                    }
                    PropertyChanges {
                        target: textSwitchCirBreak
                        text: qsTr("出口断路器合")
                    }
                },
                State {
                    name: "3"
                    PropertyChanges {
                        target: imageSwitchCirBreak
                        source: ""
                    }
                    PropertyChanges {
                        target: textSwitchCirBreak
                        text: qsTr("出口断路器状态未知")
                    }
                    PropertyChanges {
                        target: textSwitchCirBreak
                        x:-90
                        y:-70
                    }
                }
            ]

        }

        Image {
            id: imageSwitchMagnetic
            x: 294*root.minSize
            y: 460*root.minSize
            width: sourceSize.width*1.5*root.minSize
            height: sourceSize.height*1.5*root.minSize
            fillMode: Image.PreserveAspectCrop
            source: "../picture/p2_systemSimple/switch.png"
            //            state: "1"

            Text {color: majorColor
                id: textSwitchMagnetic
                text: qsTr("灭磁开关分")
                font.bold: true
                font.family: "Verdana"
                anchors.horizontalCenter: parent.horizontalCenter
                anchors.top: parent.bottom
                font.pixelSize: 20
            }

            states:[
                State {
                    name: "1"
                    PropertyChanges {
                        target: imageSwitchMagnetic
                        source: "../picture/p2_systemSimple/switch.png"
                    }
                    PropertyChanges {
                        target: textSwitchMagnetic
                        text: qsTr("灭磁开关分")
                    }
                },
                State {
                    name: "2"
                    PropertyChanges {
                        target: imageSwitchMagnetic
                        source: "../picture/p2_systemSimple/switch_on.png"
                    }
                    PropertyChanges {
                        target: textSwitchMagnetic
                        text: qsTr("灭磁开关合")
                    }
                },
                State {
                    name: "3"
                    PropertyChanges {
                        target: imageSwitchMagnetic
                        source: "../picture/p2_systemSimple/switch.png"
                    }
                    PropertyChanges {
                        target: textSwitchMagnetic
                        text: qsTr("灭磁开关位置错误")
                    }
                }
            ]
        }

        Rectangle {
            id: rectangle_regChannel
            x: 370*root.minSize
            y: 210*root.minSize
            width: 200*root.minSize
            height: 115*root.minSize
            color: majorColorDeep
            radius: 10*root.minSize
            property int textSize: 20*root.minSize

            Text {color: majorColor
                x: 10*root.minSize
                y: 25*root.minSize
                text: "A通道:"
                font.bold: true
                font.family: "Verdana"
                font.pixelSize: parent.textSize
            }

            Text {color: majorColor
                x: 10*root.minSize
                y: 70*root.minSize
                text: "B通道:"
                font.bold: true
                font.family: "Verdana"
                font.pixelSize: parent.textSize
            }

            Text {color: majorColor
                id:text_mainStatuChA
                x: 95*root.minSize
                y: 25*root.minSize
                text: qsTr("备用")
                font.bold: true
                font.family: "Verdana"
                font.pixelSize: parent.textSize
                states:[State {name: "2";PropertyChanges {target: text_mainStatuChA;text: qsTr("备用");}},
                    State {name: "1";PropertyChanges {target: text_mainStatuChA;text: qsTr("主用");}}]
            }


            Text {color: majorColor
                id:text_mainStatuChB
                x: 95*root.minSize
                y: 70*root.minSize
                text: qsTr("备用")
                font.bold: true
                font.family: "Verdana"
                font.pixelSize: parent.textSize
                states:[State {name: "2";PropertyChanges {target: text_mainStatuChB;text: qsTr("备用");}},
                    State {name: "1";PropertyChanges {target: text_mainStatuChB;text: qsTr("主用");}}]
            }

            Text {color: majorColor
                id:text_runModelChA
                x: 156*root.minSize
                y: 25*root.minSize
                text: qsTr("手动")
                font.bold: true
                font.pixelSize: parent.textSize
                font.family: "Verdana"
                states:[State {name: "2";PropertyChanges {target: text_runModelChA;text: qsTr("手动");}},
                    State {name: "1";PropertyChanges {target: text_runModelChA;text: qsTr("自动");}}]
            }

            Text {color: majorColor
                id:text_runModelChB
                x: 156*root.minSize
                y: 70*root.minSize
                text: qsTr("手动")
                font.bold: true
                font.pixelSize: parent.textSize
                font.family: "Verdana"
                states:[State {name: "2";PropertyChanges {target: text_runModelChB;text: qsTr("手动");}},
                    State {name: "1";PropertyChanges {target: text_runModelChB;text: qsTr("自动");}}]
            }
        }

        Rectangle {
            id: rect_powerCui
            width: 530*root.minSize
            height: 280*root.minSize
            color: majorColorDeep
            radius: 10*root.minSize
            property real textSize: 18*root.minSize
            x: 440*root.minSize
            y: 330*root.minSize

            Rectangle {
                x: 15*root.minSize
                y: 20*root.minSize
                width: 420*root.minSize
                height: 70*root.minSize
                color: text_powerCabinet1_cutin.state=="1"?"#88cbdfac":"#66ff1493"
                radius: 10*root.minSize

                Text {color: majorColor
                    x: 70*root.minSize
                    y: 10*root.minSize
                    text: qsTr("1号功率柜:")
                    font.pixelSize: rect_powerCui.textSize
                }

                Text {color: majorColor
                    id: text_powerCabinet1_Cur
                    x: 162*root.minSize
                    y: 10*root.minSize
                    text: qsTr("???A")
                    font.pixelSize: rect_powerCui.textSize
                }

                Text {color: majorColor
                    x: 70*root.minSize
                    y: 35*root.minSize
                    text: qsTr("风温1:")
                    font.pixelSize: rect_powerCui.textSize
                }

                Text {color: majorColor
                    id: text_powerCabinet1_Temp1
                    x: 125*root.minSize
                    y: 35*root.minSize
                    text: qsTr("???°C")
                    font.family: "Tahoma"
                    font.pixelSize: rect_powerCui.textSize
                }

                Text {color: majorColor
                    x: 240*root.minSize
                    y: 35*root.minSize
                    text: qsTr("风温2:")
                    font.pixelSize: rect_powerCui.textSize
                }

                Text {color: majorColor
                    id: text_powerCabinet1_Temp2
                    x: 300*root.minSize
                    y: 35*root.minSize
                    text: qsTr("???°C")
                    font.family: "Tahoma"
                    font.pixelSize: rect_powerCui.textSize
                }

                Text {color: majorColor
                    id:text_powerCabinet1_cutin
                    x: 240*root.minSize
                    y: 10*root.minSize
                    //                    text: qsTr("本柜投入")
                    font.pixelSize: rect_powerCui.textSize
                    state: "1"
                    states:[
                        State {name: "1";PropertyChanges {
                                target: text_powerCabinet1_cutin;
                                text: qsTr("本柜投入");color:"blue"}},
                        State {name: "2";PropertyChanges {
                                target: text_powerCabinet1_cutin;
                                text: qsTr("本柜退出");color:"red"}}
                    ]
                }

                Text {color: majorColor
                    id:text_powerCabinet1_CurEqu
                    x: 330*root.minSize
                    y: 10*root.minSize
                    //                    text: qsTr("均流退出")
                    font.pixelSize: rect_powerCui.textSize
                    state: "1"
                    states:[
                        State {name: "1";PropertyChanges {
                                target: text_powerCabinet1_CurEqu;
                                text: qsTr("均流退出");color:"grey"}},
                        State {name: "2";PropertyChanges {
                                target: text_powerCabinet1_CurEqu;
                                text: qsTr("均流投入");color:"blue"}}
                    ]
                }

                Image {
                    id: image
                    x: 10*root.minSize
                    y: 10*root.minSize
                    width: sourceSize.width*root.minSize
                    height: sourceSize.height*root.minSize
                    fillMode: Image.PreserveAspectFit
                    source: "../picture/p2_systemSimple/thyristor.png"
                }
            }
            Rectangle {
                x: 15*root.minSize
                y: 110*root.minSize
                width: 420*root.minSize
                height: 70*root.minSize
                color: text_powerCabinet2_cutin.state=="1"?"#88cbdfac":"#66ff1493"
                radius: 10*root.minSize

                Text {color: majorColor
                    x: 70*root.minSize
                    y: 10*root.minSize
                    text: qsTr("2号功率柜:")
                    font.pixelSize: rect_powerCui.textSize
                }

                Text {color: majorColor
                    id: text_powerCabinet2_Cur
                    x: 162*root.minSize
                    y: 10*root.minSize
                    text: qsTr("???A")
                    font.pixelSize: rect_powerCui.textSize
                }

                Text {color: majorColor
                    x: 70*root.minSize
                    y: 35*root.minSize
                    text: qsTr("风温1:")
                    font.pixelSize: rect_powerCui.textSize
                }

                Text {color: majorColor
                    id: text_powerCabinet2_Temp1
                    x: 125*root.minSize
                    y: 35*root.minSize
                    text: qsTr("???°C")
                    font.family: "Tahoma"
                    font.pixelSize: rect_powerCui.textSize
                }

                Text {color: majorColor
                    x: 240*root.minSize
                    y: 35*root.minSize
                    text: qsTr("风温2:")
                    font.pixelSize: rect_powerCui.textSize
                }

                Text {color: majorColor
                    id: text_powerCabinet2_Temp2
                    x: 300*root.minSize
                    y: 35*root.minSize
                    text: qsTr("???°C")
                    font.family: "Tahoma"
                    font.pixelSize: rect_powerCui.textSize
                }

                Text {color: majorColor
                    id:text_powerCabinet2_cutin
                    x: 240*root.minSize
                    y: 10*root.minSize
                    //                    text: qsTr("本柜投入")
                    font.pixelSize: rect_powerCui.textSize
                    state: "1"
                    states:[
                        State {name: "1";PropertyChanges {
                                target: text_powerCabinet2_cutin;
                                text: qsTr("本柜投入");color:"blue"}},
                        State {name: "2";PropertyChanges {
                                target: text_powerCabinet2_cutin;
                                text: qsTr("本柜退出");color:"red"}}
                    ]
                }

                Text {color: majorColor
                    id:text_powerCabinet2_CurEqu
                    x: 330*root.minSize
                    y: 10*root.minSize
                    //                    text: qsTr("均流退出")
                    font.pixelSize: rect_powerCui.textSize
                    state: "1"
                    states:[
                        State {name: "1";PropertyChanges {
                                target: text_powerCabinet2_CurEqu;
                                text: qsTr("均流退出");color:"grey"}},
                        State {name: "2";PropertyChanges {
                                target: text_powerCabinet2_CurEqu;
                                text: qsTr("均流投入");color:"blue"}}
                    ]
                }

                Image {
                    x: 10*root.minSize
                    y: 10*root.minSize
                    width: sourceSize.width*root.minSize
                    height: sourceSize.height*root.minSize
                    fillMode: Image.PreserveAspectFit
                    source: "../picture/p2_systemSimple/thyristor.png"
                }
            }
            Rectangle {
                x: 15*root.minSize
                y: 195*root.minSize
                width: 420*root.minSize
                height: 70*root.minSize
                color: text_powerCabinet3_cutin.state=="1"?"#88cbdfac":"#66ff1493"
                radius: 10*root.minSize

                Text {color: majorColor
                    x: 70*root.minSize
                    y: 10*root.minSize
                    text: qsTr("3号功率柜:")
                    font.pixelSize: rect_powerCui.textSize
                }

                Text {color: majorColor
                    id: text_powerCabinet3_Cur
                    x: 162*root.minSize
                    y: 10*root.minSize
                    text: qsTr("???A")
                    font.pixelSize: rect_powerCui.textSize
                }

                Text {color: majorColor
                    x: 70*root.minSize
                    y: 35*root.minSize
                    text: qsTr("风温1:")
                    font.pixelSize: rect_powerCui.textSize
                }

                Text {color: majorColor
                    id: text_powerCabinet3_Temp1
                    x: 125*root.minSize
                    y: 35*root.minSize
                    text: qsTr("???°C")
                    font.family: "Tahoma"
                    font.pixelSize: rect_powerCui.textSize
                }

                Text {color: majorColor
                    x: 240*root.minSize
                    y: 35*root.minSize
                    text: qsTr("风温2:")
                    font.pixelSize: rect_powerCui.textSize
                }

                Text {color: majorColor
                    id: text_powerCabinet3_Temp2
                    x: 300*root.minSize
                    y: 35*root.minSize
                    text: qsTr("???°C")
                    font.family: "Tahoma"
                    font.pixelSize: rect_powerCui.textSize
                }

                Text {color: majorColor
                    id:text_powerCabinet3_cutin
                    x: 240*root.minSize
                    y: 10*root.minSize
                    text: qsTr("本柜投入")
                    font.pixelSize: rect_powerCui.textSize
                    state: "1"
                    states:[
                        State {name: "1";PropertyChanges {
                                target: text_powerCabinet3_cutin;
                                text: qsTr("本柜投入");color:"blue"}},
                        State {name: "2";PropertyChanges {
                                target: text_powerCabinet3_cutin;
                                text: qsTr("本柜退出");color:"red"}}
                    ]
                }

                Text {color: majorColor
                    id:text_powerCabinet3_CurEqu
                    x: 330*root.minSize
                    y: 10*root.minSize
                    //                    text: qsTr("均流退出")
                    font.pixelSize: rect_powerCui.textSize
                    state: "1"
                    states:[
                        State {name: "1";PropertyChanges {
                                target: text_powerCabinet3_CurEqu;
                                text: qsTr("均流退出");color:"grey"}},
                        State {name: "2";PropertyChanges {
                                target: text_powerCabinet3_CurEqu;
                                text: qsTr("均流投入");color:"blue"}}
                    ]
                }

                Image {
                    x: 10*root.minSize
                    y: 10*root.minSize
                    width: sourceSize.width*root.minSize
                    height: sourceSize.height*root.minSize
                    fillMode: Image.PreserveAspectFit
                    source: "../picture/p2_systemSimple/thyristor.png"
                }
            }

            Text {color: majorColor
                x: 450*root.minSize
                y: 75*root.minSize
                text: qsTr("均流系数")
                font.bold: true
                font.family: "Verdana"
                font.pixelSize: 18*root.minSize
            }
            Text {color: majorColor
                id:text_junliu
                x: 460*root.minSize
                y: 115*root.minSize
                text: "???%"
                font.bold: true
                font.family: "Verdana"
                font.pixelSize: 18*root.minSize
            }

        }

        Rectangle {
            id: rectangle3
            x: 330*root.minSize
            y: 10*root.minSize
            width: 300*root.minSize
            height: 150*root.minSize
            color: majorColorLow
            radius: 10*root.minSize
            property int textSize: 22*root.minSize

            Text {color: majorColor
                x: 10*root.minSize
                y: 12*root.minSize
                text: "Ug:"
                font.family: "Verdana"
                font.pixelSize: parent.textSize
            }

            Text {color: majorColor
                x: 14*root.minSize
                y: 60*root.minSize
                text: "Ig:"
                font.family: "Verdana"
                font.pixelSize: parent.textSize
            }

            Text {color: majorColor
                id: text_ug
                x: 50*root.minSize
                y: 10*root.minSize
                text: "0V"
                font.pixelSize: parent.textSize
            }

            Text {color: majorColor
                id: text_ig
                x: 50*root.minSize
                y: 60*root.minSize
                text: "0A"
                font.pixelSize: parent.textSize
            }

            Text {color: majorColor
                x: 22*root.minSize
                y: 110*root.minSize
                text: "F:"
                font.family: "Verdana"
                font.pixelSize: parent.textSize
            }

            Text {color: majorColor
                id: text_f
                x: 50*root.minSize
                y: 110*root.minSize
                text: "0.00Hz"
                font.pixelSize: parent.textSize
            }

            Text {color: majorColor
                id: text_ugPer
                x: 210*root.minSize
                y: 10*root.minSize
                text: "0.0%"
                horizontalAlignment: Text.AlignRight
                font.pixelSize: parent.textSize
            }

            Text {color: majorColor
                id: text_igPer
                x: 210*root.minSize
                y: 60*root.minSize
                text: "0.0%"
                horizontalAlignment: Text.AlignRight
                font.pixelSize: parent.textSize
            }
        }

        Rectangle {
            id: rectangle4
            x: 700*root.minSize
            y: 10*root.minSize
            width: 300*root.minSize
            height: 150*root.minSize
            color: majorColorLow
            radius: 10*root.minSize
            property int textSize: 22*root.minSize

            Text {color: majorColor
                x: 25*root.minSize
                y: 12*root.minSize
                text: "P:"
                font.family: "Verdana"
                font.pixelSize: parent.textSize
            }

            Text {color: majorColor
                x: 25*root.minSize
                y: 60*root.minSize
                text: "Q:"
                font.family: "Verdana"
                font.pixelSize: parent.textSize
            }

            Text {color: majorColor
                id: text_p
                x: 60*root.minSize
                y: 10*root.minSize
                text: "0MW"
                font.pixelSize: parent.textSize
            }

            Text {color: majorColor
                id: text_q
                x: 60*root.minSize
                y: 60*root.minSize
                text: "0MVar"
                font.pixelSize: parent.textSize
            }

            Text {color: majorColor
                x: rect_powerCui.textSize
                y: 110*root.minSize
                text: "PF:"
                font.family: "Verdana"
                font.pixelSize: parent.textSize
            }

            Text {color: majorColor
                id: text_pf
                x: 60*root.minSize
                y: 111*root.minSize
                text: "0.00"
                font.pixelSize: parent.textSize
            }

            Text {color: majorColor
                id: text_pPer
                x: 210*root.minSize
                y: 10*root.minSize
                text: "0.0%"
                horizontalAlignment: Text.AlignRight
                font.pixelSize: parent.textSize
            }

            Text {color: majorColor
                id: text_qPer
                x: 210*root.minSize
                y: 60*root.minSize
                text: "0.0%"
                horizontalAlignment: Text.AlignRight
                font.pixelSize: parent.textSize
            }
        }

        Image {
            id: image_rotor
            x: 45*root.minSize
            y: 429*root.minSize
            width: 100*root.minSize
            height: 100*root.minSize
//            source: "../picture/p2_systemSimple/rotorz.png"
            fillMode: Image.PreserveAspectFit

            state: "1"
            states:[
                State {name: "1";PropertyChanges {
                        target: image_rotor;
                        source: "../picture/p2_systemSimple/rotorz.png"
                    }},
                State {name: "2";PropertyChanges {
                        target: image_rotor;
                        source: "../picture/p2_systemSimple/rotorf.png"
                    }}
            ]
        }
    }
}



